//  Allows change to occur
setInterval(function () {
    // The changing functions 
    contentChange();
    reveil();
}, 1);


//  Starts the Youtube Music Playlist (randomized playlist)
function newPlaylist() {
    if (person == "Von" || person == "von" || person == "Mommy") {
        var playListSites = ['https://youtube.com/embed/QjwfbpKON0E?list=PLA2378E56613A78CF?&autoplay=1'];
    } else if (person == "Ria" || person == "ria") {
    var PlayListSites = ['https://www.youtube.com/embed/HIHrapMU0pc?list=PL3vXTsRTRYu7-JoeDBmLNe7f7DoAh5v-J?&autoplay=1']; 
    } else {
        var PlayListSites = ['https://www.youtube.com/embed/AiOuEGijfOk?list=PL210AC6CB16B52D5B?&autoplay=1'];
    }
        // add more playlist to be effective
    
    var i = Math.floor(Math.random() * PlayListSites.length);

    document.getElementById('YoutubeIframe').src = PlayListSites[i];
}


//  Dyamically resizes iframe and side menu
function contentChange() {
    // Sizes to modify the height and width
    var contentResizeWidth = window.innerWidth + (-150);
    var contentResizeHeight = window.innerHeight + (-100);

    // Elements that are getting modded
    document.getElementById('content').setAttribute("style", "height:" + contentResizeHeight + "px; width:" + contentResizeWidth + "px; float:left;");
    document.getElementById('menu').setAttribute("style", "background-color:#555555; float:left; width: 115px; height: " + contentResizeHeight + "px;");
}

//  Thank you Jp
alert("Thank you Jp for helping me with some of this stuff.\n\nIf you need help with your profile hit Jp up.\nHis profile is in a tab below");

//  Allows user to input who they are so they can recieve their own personal messages
var person = prompt("What is your name?(cap sensitive)\n\n(after this, press click me for more)");

//  Allows users to recieve special messages
function Comments4Friends() {
    if (person == "Ria") {
        alert("Hey " + person + " <3 How are you today?  I really do miss you.");
        write.innerHTML = "<head><style> .demo {background-color: #000;}; .Ria{outline I miss you so much <font color='hotpink'>&lt;3</font>  I think of you all of the time now.  I wish I could fly to you and see you.  <br><br> I haven't finished yet... but I will soon <br><br> *he blows her a kiss* I love you";
    } else if (person == "Ian" || person == "Ran" || person == "Random") {
        alert("Really... you put " + person + " in that prompt... \n   Well yeah, he did all of this.");
        write.innerHTML = "I relize that you are not him cause he does not have the same IP address as you *devious smile*";
    } else if (person == "Night") {
        alert("Hey " + person + "!  Your such a good mommy ^.^");
        write.innerHTML = "<h1> Mommy, I love you... and I try to be there for you.<br>Please remember that.  I will try my best to be there, support you, and help you out to the best of my ability.</h1>";
    } else if (person == "Psy" || person == "Thomas") {
        alert("Hey " + person + ".  How have you been man");
        write.innerHTML = person + "... to be honest, idk what to say to you.  I need to know you better actually say something about ya.<br><dd>Sorry";
    } else if (person == "Jp" || person == "Digitalclay" || person == "DigitalClay") {
        alert("What up " + person + ", do you like how my script is coming?");
        write.innerHTML = "<h1>WHAT UP!!!<h1><br><br><p>How is it going?</p>";
    } else if (person == "Jane") {
        alert("How is my daughter doing ^.^");
        write.innerHTML = "Your such a sweet girl";
    } else if (person == "Blue") {
        alert("How is my son doing? *gives " + person + " a highfive*");
        write.innerHTML = "Your an awesome son to have";
    } else if (person == "Anna") {
        alert("Hey " + person + "! *he picks her up into a hug*");
        write.innerHTML = "I miss you so much, where have you been?";
    } else if (person == "Aki") {
        alert("Hey ^^ I am so surpised that you were able to find me");
        write.innerHTML = "To be honest, I dont think your ever going to see this, but... I really do miss you.";
    } else if (person == "Suki") {
        alert("SUKI SUKI SUKI SUKI SUKI SUKI");
        alert("I love you so much, your such a sweet girl");
        write.innerHTML = "I am so happy that you are seeing my main profile";
    } else if (person == "Sera") {
        alert("You need to pm me, I miss you so much");
        write.innerHTML = "*he hugs her and picks her up, then spins around* How is my sis doing?";
    } else if (person == "Slow") {
        alert("Hey slowpoke ^^");
        write.innerHTML = "How is my sis doing?";
    } else if (person == "Ripper") {
        alert("Hello Ria's dad");
        write.innerHTML = "Nice you meet you";
    } else if (person == "Raz") {
        alert("What up " + person + "!");
        write.innerHTML = "I am sorry for what happened between you and Ria";
    } else if (person == "Rukia") {
        alert("RUKIA, HEY!!!");
        write.innerHTML = "your so fun to be around ^.^";
    } else if (person == "Hanabi") {
        alert("Hello " + person + "!");
        write.innerHTML = "Hey Hanabi, I dont think we have truely talked to each other.  Anyways Hello ^^";
    } else if (person == "Iggy") {
        alert("Hello " + person + "!");
        write.innerHTML = "Hey Iggy, how is it going";
    } else if (person === "") {
        x = "Hey... no name? ...Well how have you been today?";
        write.innerHTML = x;
    } else if (person === null) {
        x = "Hey! Why did you cancel?";
        write.innerHTML = x;
    } else if (person !== "") {
        x = "Hello " + person + "!  How are you today?";
        write.innerHTML = x;
    }
}

/* There is a div at the beginning that visibility to html
   This function allows the div to be removed through 
   display = "block" to display = "none"                  */
function reveil() {
    document.getElementById('Block').style.display = "none";
}

// Notifies the user that the part they are accessing is not finshed yet
function Not_Finished() {
    alert('Sorry, but this part of the page is not finished yet. \nIt still in testing\n\nRan: I will get it done soon (I am trying my best)');
}

//  Allows user to see their messages
function iframe_off() {
    document.getElementById("Iframe").style.display = "none";
}

//  Allows users to the Iframe again
function iframe_on() {
    document.getElementById("Iframe").style.display = "block";
}

//  This not needed, but is nice to have
document.getElementsByTagName('header')[0].innerHTML = "<title>Ran's Profile</title>";
